]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Swap arrow alignment on RTL
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 29 Jan 2024 16:41:54 +0000 (17:41 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 29 Jan 2024 22:40:12 +0000 (22:40 +0000)
The current code uses the arrow alignment to align the menu between
the top/left (0) and bottom/right(1), regardless of the text direction.

Instead of adjusting code everywhere, reinterpret the parameter
to refer to start/end instead, and swap the alignment with an
RTL text direction.

Credit to Sebastian Keller for spotting the cause of the issue.

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5261
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7356

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3150>

js/ui/boxpointer.js

index 53433245d93fd6ad1f5d320c7276276e28bd560f..8c410201e95f41faa9055d8d9ace7ef0b18265d4 100644 (file)
@@ -533,6 +533,9 @@ export const BoxPointer = GObject.registerClass({
         switch (this._arrowSide) {
         case St.Side.TOP:
         case St.Side.BOTTOM:
+            if (this.text_direction === Clutter.TextDirection.RTL)
+                alignment = 1.0 - alignment;
+
             resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
 
             resX = Math.max(resX, workarea.x + padding);